package com.wangbo.rabbit;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.experimental.Accessors;

/**
 * 自定义 rabbit 消息
 */
@Data
@Accessors(chain = true)
public class RabbitMessage<T> {
    private int messageId; // 消息ID
    private T payload; // 消息体
    private BizType bizType; // 业务类型

    @Getter
    @AllArgsConstructor
    public static enum BizType {
        ADD_USER(1, "添加用户"),
        UPDATE_USER(2, "更新用户");

        private final int code;
        private final String desc;
    }

}
